package com.ruoyi.season.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.appuser.domain.vo.AppuserPlayVO;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.season.domain.PlaySeason;
import com.ruoyi.season.domain.vo.PlaySeasonInfoVo;
import com.ruoyi.season.mapper.PlaySeasonMapper;
import com.ruoyi.season.service.IPlaySeasonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 赛季Service业务层处理
 *
 * @author ruoyi
 * @date 2024-01-14
 */
@Service
public class PlaySeasonServiceImpl extends ServiceImpl<PlaySeasonMapper,PlaySeason> implements IPlaySeasonService
{
    @Autowired
    private PlaySeasonMapper playSeasonMapper;

    /**
     * 查询赛季
     *
     * @param id 赛季主键
     * @return 赛季
     */
    @Override
    public PlaySeason selectPlaySeasonById(String id)
    {
        return playSeasonMapper.selectPlaySeasonById(id);
    }

    /**
     * 查询赛季列表
     *
     * @param playSeason 赛季
     * @return 赛季
     */
    @Override
    public List<PlaySeason> selectPlaySeasonList(PlaySeason playSeason)
    {
        return playSeasonMapper.selectPlaySeasonList(playSeason);
    }

    /**
     * 新增赛季
     *
     * @param playSeason 赛季
     * @return 结果
     */
    @Override
    public int insertPlaySeason(PlaySeason playSeason)
    {
        playSeason.setCreateTime(DateUtils.getNowDate());
        return playSeasonMapper.insertPlaySeason(playSeason);
    }

    /**
     * 修改赛季
     *
     * @param playSeason 赛季
     * @return 结果
     */
    @Override
    public int updatePlaySeason(PlaySeason playSeason)
    {
        return playSeasonMapper.updatePlaySeason(playSeason);
    }

    /**
     * 批量删除赛季
     *
     * @param ids 需要删除的赛季主键
     * @return 结果
     */
    @Override
    public int deletePlaySeasonByIds(String[] ids)
    {
        return playSeasonMapper.deletePlaySeasonByIds(ids);
    }

    /**
     * 删除赛季信息
     *
     * @param id 赛季主键
     * @return 结果
     */
    @Override
    public int deletePlaySeasonById(String id)
    {
        return playSeasonMapper.deletePlaySeasonById(id);
    }

    @Override
    public AppuserPlayVO selectPayInfo(String playSeasonId) {
        return baseMapper.selectPayInfo(playSeasonId);
    }

    @Override
    public List<PlaySeasonInfoVo> selectPlaySeasonInfo(IPage<PlaySeasonInfoVo> page) {
        return baseMapper.selectPlaySeasonInfo(page);
    }
}
